/*
 * @Descripttion: 
 * @version: 
 * @Author: hzj-1510017964@qq.com
 * @Date: 2020-04-22 11:39:04
 * @LastEditors: hzj-1510017964@qq.com
 * @LastEditTime: 2020-04-26 14:33:42
 */
const Sequelize = require('sequelize');

const db = require('../config/dbconfig')

const UserDao = db.define('k_user', {
    name: {
        type: Sequelize.STRING
    },
    password: {
        type: Sequelize.STRING
    },
    uuid:{
        type:Sequelize.STRING,

    },
    phone:{
        type:Sequelize.STRING
    },
    email:{
        type:Sequelize.STRING
    }
})



login = (param) => {
    return UserDao.findOne({
        where: param
    })
}

//用户注册首先查询一遍
queryUser = (param) =>{
    return UserDao.findOne({
        where:param
    })
}



//添加用户
 addUser = (param) =>{
    return UserDao.create(param)
}






module.exports = {
    login,
    addUser,
    queryUser
}